local yuanhu_active = fk.CreateSkill {

  name = "fk__yuanhu_active",

  tags = {  },

}

local U = require "packages/utility/utility"


yuanhu_active:addEffect("active", {
  name = "fk__yuanhu_active",
  mute = true,
  card_num = 1,
  target_num = 1,
  card_filter = function(self, player,to_select, selected)
    return #selected == 0 and to_select.type == Card.TypeEquip
  end,
  interaction = function()
    return UI.ComboBox {choices = {"$Equip", "$Hand"} }
  end,
  target_filter = function(self, player, to_select, selected, cards)
    if #selected == 0 and #cards == 1 then
      local to = to_select
      if self.interaction.data == "$Equip" then
        return to:hasEmptyEquipSlot(Fk:getCardById(cards[1]).sub_type)
      else
        return not (table.contains(player.player_cards[Player.Hand], cards[1]) and to_select == player)
      end
    end
  end,
})

return yuanhu_active